<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<script type="text/javascript">


</script>
<div class="table-scrollable">
    <input type="hidden" name="id" id="orderId"/>
    <table class="table table-striped table-hover table-success">
        <thead>
        <tr>
            <th class="text-center">序号</th>
            <th class="text-center">订单编号</th>
            <th class="text-center">预约时间</th>
            <th class="text-center">真实姓名</th>
            <th class="text-center">手机号</th>
            <th class="text-center">预约医院</th>
            <th class="text-center">科室</th>
            <th class="text-center">接诊护士</th>
            <th class="text-center">医生</th>
            <th class="text-center">当前状态</th>
            <th class="text-center">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.result}" var="orders" varStatus="vs">
            <tr class="text-center">
                <td>${vs.count + page.offset}</td>
                    <%--订单编号--%>
                <td>${orders.orderCode}</td>
                    <%--预约时间--%>
                <td>
                    <fmt:formatDate value="${orders.appointmentTime}" pattern="yyyy-MM-dd"/>
                </td>
                    <%--真实姓名--%>
                <td>${orders.patientName}</td>
                    <%--手机号--%>
                <td>${orders.patientPhone}</td>
                    <%--预约医院--%>
                <td>${orders.hospitalName}</td>
                    <%--科室--%>
                <td>${orders.departmentName}</td>
                    <%--接诊护士--%>
                <td>${orders.nurseName}</td>
                    <%--医生--%>
                <td>
                    <c:if test="${orders.orderStatus == 3}">
                        <a href="javascript:;" onclick="auditTab('${orders.orderId}')" style="width: 55px;">
                            <i class="fa"></i>分配医生
                        </a>
                    </c:if>
                    <c:if test="${orders.orderStatus != 3}">${orders.doctorName}</c:if>
                </td>
                    <%--订单状态：1、等待确认，2、等待分配，3、等待检查，4、等待方案,5、已完成，6、已取消--%>
                <td>
                    <c:if test="${orders.orderStatus == 1}">等待确认</c:if>
                    <c:if test="${orders.orderStatus == 2}">等待分配</c:if>
                    <c:if test="${orders.orderStatus == 3}">等待检查</c:if>
                    <c:if test="${orders.orderStatus == 4}">等待方案</c:if>
                    <c:if test="${orders.orderStatus == 5}">已完成</c:if>
                    <c:if test="${orders.orderStatus == 6}">已取消</c:if>
                </td>
                    <%--操作--%>
                <td>
                    <a href="javascript:;" class="btn btn-info" onclick="show('/orders/orders?id=${orders.orderId}')">
                        <i class="fa"></i>查看
                    </a>
                    <c:if test="${orders.orderStatus != 5 && orders.orderStatus != 6}">
                        <a href="javascript:;" class="btn btn-info"
                           onclick="update('/orders/orders?id=${orders.orderId}')">
                            <i class="fa"></i>编辑
                        </a>
                    </c:if>
                    <c:if test="${orders.orderStatus != 5 && orders.orderStatus != 6}">
                        <a href="javascript:;" class="btn btn-info"
                           onclick="cancelOrder('/orders/cancelOrder?id=${orders.orderId}')">
                            <i class="fa"></i>取消
                        </a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<div class="pageination-panel">${page}</div>
<div id="doctorListId"></div>
